<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="base.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>编程之友BBS-发帖页</title>
	<link rel="stylesheet" type="text/css" href="style/top.css"/>
	<link rel="stylesheet" type="text/css" href="style/main.css"/>
	<link rel="stylesheet" type="text/css" href="style/footer.css"/>
	<script type="text/javascript" src="script/jquery.js"></script>
	<script type="text/javascript" src="script/jquery.validate.js"></script>
	<script type="text/javascript" src="script/kindeditor/kindeditor-min.js"></script>
	<script type="text/javascript">
	
	$().ready(function() {
		$("#article_form").validate({
			rules: {
				title: {
					required: true,
					minlength: 4
				},
				content: {
					required: true,
					minlength: 30
				}
			},
			messages: {
				title: {
					required: "标题不能为空",
					minlength: "最短4个字符"
				},
				content: {
					required: "内容不能为空",
					minlength: "最短30个字符，请认真填写！"
				}
			}
		
		});
	
	});
	KE.show({
					id : 'content',
					imageUploadJson : '${basePath}/upload_json.jsp',
					resizeMode : 1,
					allowPreviewEmoticons : false,
					syncType : 'auto',
					allowUpload : true,
					items : [
					'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
					'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
					'insertunorderedlist', '|', 'emoticons', 'image', 'link']
	});
	</script>
</head>

<body>
	<!-- head开始 -->
	<%@ include file="template/head.jsp" %>
	<!-- head结束 -->
	<div style="margin-top: 10px;"></div>
	<!-- 中间主体部分开始 -->
	<div id="wp" class="wp">
    	<!-- 导航开始 -->
    	<div id="pt" class="bm cl">
            <div id="ct" class="ct2_a wp cl">
                <div class="z">
                    <a class="nvhm" title="首页" href="#">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
                    <em>›</em>
                    <a href="blocks?_method=show&id=${requestScope.blocks.id }">${requestScope.blocks.name }</a>
                    <em>›</em>
                    	发表帖子
                </div>
            </div>
       	</div>
        <!-- 导航结束 -->
        
        <!-- 发帖主体开始 -->
        <div id="ct" class="ct2_a wp cl">
        	<div class="mn">
            	<form id="article_form" action="article.jspx?_method=create" onsubmit="return subcheck();" method="post">
                	<div id="editorbox" class="bm bw0 cl">
                    	<h1 id="sti" class="mt">
                        	<em id="returnmessage" class="wx"> 发表帖子 </em>
                        </h1>
                        <div id="postbox">
                        	<div class="pbt cl" style="line-height: 36px;">
                            	<div class="ftid">
                                	
                                </div>
                                <div class="z">
                                	<span>
                                		<input type="hidden" name="blocksid" value="${requestScope.blocks.id }"/>
                                    	<label for="title">
                                       		 标题：
                                        </label>
                                        <input type="text" id="title" class="px" style="width: 25em;" name="title" onblur="checktitle()" />
                                    </span>
                                </div>
                            </div>
                            <div style="margin-top:10px;"></div>
                            <div class="clear"></div>
                            
                            <div id="e_body" class="edt simpleedt" style="visibility: visible; margin-top: 10px;">
                            	<div>
                            		<label for="content"></label>
                                	<textarea id="content" class="area" name="content">
                                    </textarea>
                                </div>
                                <label id="contentmsg" class="error"></label>
                            </div>
                            
                            <div class="mtm mbm">
                            	<input type="submit" value="发表帖子" class="pn pnc" /> 
                            	<button id="postsubmit" class="pn pnc" name="contentsubmit" value="true" type="submit">
                                	<span>发表帖子</span>
                                </button>
                                
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <!-- 发帖主题结束 -->
        
    </div>
    <!-- 中间主体部分结束 -->
    <!-- footer开始 -->
	<%@ include file="template/footer.jsp" %>
    <!-- footer结束 -->
</body>

</html>